function onPageInput(total){
	var page = document.getElementById("curPage").value;
	for(var i=0; i<page.length; i++)
		if( page.charAt(i) <= '0' || page.charAt(i) > '9' ){
			alert("Please input a number bigger than 0~~");
			return;
		}
	if( page > total )
		document.getElementById("curPage").value = total;
	onSubmit();
}

function onPage(page, total){
	if( page < 1 || page > total ) return;
	document.getElementById("curPage").value = page;
	onSubmit();
}


function onAllCheck(){
	if( !document.getElementsByName("itemCheckBox") ) return;
	if( document.getElementsByName("itemCheckBox").length )
		for( var i=0; i<document.getElementsByName("itemCheckBox").length; i++){
			document.getElementsByName("itemCheckBox")[i].checked = document.getElementById("allCheck").checked;
		}
}

function onOneCheck(){
	if( document.getElementsByName("itemCheckBox").length )
		for( var i=0; i<document.getElementsByName("itemCheckBox").length; i++){
			if( !document.getElementsByName("itemCheckBox")[i].checked ){
				document.getElementById("allCheck").checked = false;
				break;
			}
		}
	else
		if( !document.getElementsByName("itemCheckBox").checked )
			document.getElementById("allCheck").checked = false;
}
		